package com.example.sbeducation.exception;

import lombok.Getter;

/**
 * 业务异常
 */
@Getter
public class BusinessException extends RuntimeException {

  /**
   * 错误码
   */
  private Integer code;

  /**
   * 错误消息
   */
  private String message;

  public BusinessException(String message) {
    super(message);
    this.code = 500;
    this.message = message;
  }

  public BusinessException(Integer code, String message) {
    super(message);
    this.code = code;
    this.message = message;
  }
}